package controller;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.net.URISyntaxException;

import javax.annotation.processing.FilerException;

public class DataTable {

private final static String table_Name ="Valeurs.csv";
private final static String table_path ="src/controller/";
		
		public DataTable()
		{
			
			
		}
		
		public String[][] Recuperation_information() throws IOException, URISyntaxException
		{
			String[][] tabChaine = new String[8][];
			
			try
			{
				
			   File file = new File(getTablePath()+getTableName());
			   BufferedReader buffer = new BufferedReader(new FileReader(file));
			   String chaine;
			   int i = 0;
			 
			   while((chaine = buffer.readLine())!= null)
			   {
			     tabChaine[i] = chaine.split(";");
			      i++;
			   }
			  buffer.close();                 
			}
			catch (FilerException e)
			{
			   System.out.println("Le fichier est introuvable !");
			}
			
			
			return tabChaine;
		}

		public static String getTablePath() {
			return table_path;
		}

		public static String getTableName() {
			return table_Name;
		}
		
	}
